Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change order of lines to properly raise events #1545

Merged
merged 5 commits into from May 9, 2018

Conversation

Rekkonnect
Copy link
Contributor

Resolves #2460 and every other future similar implementation's issues with resetting values.

This is not really tested, but it should (hopefully) not break anything.

@Aergwyn
Copy link
Member

Aergwyn commented May 8, 2018

What do you mean not tested? And why does the lines changing order fix it?

@Rekkonnect
Copy link
Contributor Author

Rekkonnect commented May 8, 2018

I mean that I did not check if the entire game remains sane. Changing the order of these lines indeed helped resolve the issue due to the ordering of the value adjustment.

@peppy
Copy link
Sponsor Member

peppy commented May 9, 2018

This is a hard logic scenario to assess.

@peppy
Copy link
Sponsor Member

peppy commented May 9, 2018

@smoogipoo requesting your review on this as I modified the behaviour and added considerably.

peppy
peppy previously approved these changes May 9, 2018
@@ -164,14 +164,20 @@ public virtual void TriggerChange()

protected void TriggerValueChange(bool propagateToBindings = true)
{
ValueChanged?.Invoke(value);
// check a bound bindable hasn't changed the value again (it will fire its own event)
T beforePropagation = Value;

This comment was marked as off-topic.

@peppy peppy merged commit 3cde222 into ppy:master May 9, 2018
peppy added a commit to peppy/osu-framework that referenced this pull request May 10, 2018
smoogipoo added a commit that referenced this pull request May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants